<?php
/*
	Version   :  1.0
	Created   :  20081002
	Modified  :  --
	Author    :  Pablo Larenas
	co-Author :
	Descr     : Modelo de Entidad "Survey Type"
	Changelog :
*/
class SurveyType extends AppModel
{
	var $name       = 'SurveyType';
	var $id         = 'sut_codigo';
	var $primaryKey = 'sut_codigo';
	var $validate   = array('sut_codigo' => VALID_NOT_EMPTY);
	/*var $validate   = array('sut_codigo' => VALID_NOT_EMPTY,
							'sut_descripcion' => VALID_NOT_EMPTY,
							'sut_estado' => VALID_NOT_EMPTY);*/
	
	function getDescription($survey_type) {		
		$survey_type_description = $this->field('sut_descripcion', "sut_codigo = '$survey_type'");

		if (strlen($survey_type_description) < 5) {
			return $survey_type;
		} else {
			return	$survey_type_description;
		}
	}
}
?>